package com.example.apexapp;

import android.content.BroadcastReceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyBroadcastReceiver1 extends BroadcastReceiver {

    private static final String TAGS = "tags";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAGS, "我接收到了广播");
        Log.d(TAGS, "action:" + intent.getAction());
        Log.d(TAGS, "uri:" + intent.toUri(Intent.URI_INTENT_SCHEME));
        if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
            Log.d(TAGS, "正在充电~");
        }
        if (intent.getAction().equals("MyBroad.Custom")) {
            Log.d(TAGS, intent.getStringExtra("info"));
        }
    }

}
